package com.lening.collect.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.collect.dto.StatisticsDTO;
import com.lening.collect.mapper.StatisticsMapper;
import com.lening.collect.pojo.Statistics;
import com.lening.collect.service.IStatisticsService;
import com.lening.common.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ToDo:
 * @Author：杨军
 * @date: 2024/06/06 07:57
 */
@Service
public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Statistics, StatisticsDTO> implements IStatisticsService {
    @Autowired
    private StatisticsMapper mapper;


    @Override
    public Page<?> page(StatisticsDTO statisticsDTO) {

        return super.page(statisticsDTO);
    }

    @Override
    public Map<String,Object> get() {
        HashMap<String, Object> map = new HashMap<>();
        List<Statistics> records = mapper.get();

        map.put("records",records);

        return map;
    }

    @Override
    public Map<String, Object> getAll() {
        HashMap<String, Object> map = new HashMap<>();
        List<Statistics> statisticsall = mapper.getAll();
        map.put("statisticsall",statisticsall);
        return map;
    }
}